import {
  BwCustomComSoltTypeEnum,
  BwCustomComNodeAttrDataTypeEnum,
  BwCustomComNodeAttrFromTypeEnum,
  BwCustomComSlotParamDataTypeEnum,
  type BwCustomComNodeAttrModel,
  type BwCustomComNodeEnableSlotInfoModel,
} from '../../../../render/models'

const attrs: Record<string, BwCustomComNodeAttrModel> = {
  columnsType: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.array,
    constValue: JSON.stringify(['hour', 'minute']),
  },
  minHour: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.number,
    constValue: '0',
  },
  maxHour: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.number,
    constValue: '23',
  },
  minMinute: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.number,
    constValue: '0',
  },
  maxMinute: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.number,
    constValue: '59',
  },
  minSecond: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.number,
    constValue: '0',
  },
  maxSecond: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.number,
    constValue: '59',
  },
  confirmButtonText: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.string,
    constValue: '确认',
  },
  cancelButtonText: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.string,
    constValue: '取消',
  },
  showToolbar: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'true',
  },
  loading: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'false',
  },
  readonly: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'false',
  },
  optionHeight: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.string,
    constValue: '44',
  },
  visibleOptionNum: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.string,
    constValue: '6',
  },
  swipeDuration: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.string,
    constValue: '1000',
  },
}

const slotList: Array<BwCustomComNodeEnableSlotInfoModel> = [
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'toolbar',
      slotName: '自定义整个顶部栏的内容插槽',
    },
  },
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'title',
      slotName: '自定义标题内容插槽',
    },
  },
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'confirm',
      slotName: '自定义确认按钮内容插槽',
    },
  },
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'cancel',
      slotName: '自定义取消按钮内容插槽',
    },
  },
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'option',
      slotName: '自定义选项内容插槽',
      slotParams: [
        {
          paramKey: 'option',
          paramName: '选项',
          paramDataType: BwCustomComSlotParamDataTypeEnum.object,
          remark: '',
        },
        {
          paramKey: 'index',
          paramName: '选项下标',
          paramDataType: BwCustomComSlotParamDataTypeEnum.number,
          remark: '',
        },
      ],
    },
  },
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'columns-top',
      slotName: '自定义选项上方内容插槽',
    },
  },
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'columns-bottom',
      slotName: '自定义选项下方内容插槽',
    },
  },
]

export const vanTimeOptions = {
  attrs,
  slotList,
}
